package com.jiumi.baseconfig.service.impl;

import java.util.List;
import com.jiumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jiumi.baseconfig.mapper.BaseBannerInfoMapper;
import com.jiumi.baseconfig.domain.BaseBannerInfo;
import com.jiumi.baseconfig.service.IBaseBannerInfoService;

/**
 * 栏目轮播图Service业务层处理
 *
 * @author jiumi
 * @date 2023-05-21
 */
@Service
public class BaseBannerInfoServiceImpl implements IBaseBannerInfoService
{
    @Autowired
    private BaseBannerInfoMapper baseBannerInfoMapper;

    /**
     * 查询栏目轮播图
     *
     * @param id 栏目轮播图主键
     * @return 栏目轮播图
     */
    @Override
    public BaseBannerInfo selectBaseBannerInfoById(Long id)
    {
        return baseBannerInfoMapper.selectBaseBannerInfoById(id);
    }

    /**
     * 查询栏目轮播图列表
     *
     * @param baseBannerInfo 栏目轮播图
     * @return 栏目轮播图
     */
    @Override
    public List<BaseBannerInfo> selectBaseBannerInfoList(BaseBannerInfo baseBannerInfo)
    {
        return baseBannerInfoMapper.selectBaseBannerInfoList(baseBannerInfo);
    }

    /**
     * 新增栏目轮播图
     *
     * @param baseBannerInfo 栏目轮播图
     * @return 结果
     */
    @Override
    public int insertBaseBannerInfo(BaseBannerInfo baseBannerInfo)
    {
        baseBannerInfo.setCreateTime(DateUtils.getNowDate());
        return baseBannerInfoMapper.insertBaseBannerInfo(baseBannerInfo);
    }

    /**
     * 修改栏目轮播图
     *
     * @param baseBannerInfo 栏目轮播图
     * @return 结果
     */
    @Override
    public int updateBaseBannerInfo(BaseBannerInfo baseBannerInfo)
    {
        baseBannerInfo.setUpdateTime(DateUtils.getNowDate());
        return baseBannerInfoMapper.updateBaseBannerInfo(baseBannerInfo);
    }

    /**
     * 批量删除栏目轮播图
     *
     * @param ids 需要删除的栏目轮播图主键
     * @return 结果
     */
    @Override
    public int deleteBaseBannerInfoByIds(Long[] ids)
    {
        return baseBannerInfoMapper.deleteBaseBannerInfoByIds(ids);
    }

    /**
     * 删除栏目轮播图信息
     *
     * @param id 栏目轮播图主键
     * @return 结果
     */
    @Override
    public int deleteBaseBannerInfoById(Long id)
    {
        return baseBannerInfoMapper.deleteBaseBannerInfoById(id);
    }
}
